
from DjangoDemo.scripts.Http_Management import Http_Management
from DjangoDemo.scripts.SiteID import Sites
from DjangoDemo.scripts.Token import Token


class c3_1:
    # 默认深圳
    def __init__(self, site_name):

        self.site_name = Sites.get_mac(site_name)
        self.token = Token()
        # 定义接口的 URI
        GET_JOURNEY_URI = "/rest/campuswlanqualityservice/v1/expmonitor/overview/rate"
        # 配置 URL 和 Headers
        param = '''{
                "regionType" : "site",
                "level" : "0",
                "tenantId":"default-organization-id",
                "startTime":"1623729600",
                "endTime":"1623762000",
                "id":"%s"
                }''' % self.site_name

        self.r = Http_Management(self.token).get(GET_JOURNEY_URI, param)

if __name__ == '__main__':
    now = c3_1("Shenzhen")
    print(now.r.json())